<?php 
$config = array(
    'data'=>$model,
    'attributes'=>array(
        array(
            'header'=>'',
            'type'=>'raw',
            'value'=>CHtml::link(ICON_VIEW,array('/vehicle/view','id'=>$model->id),array('title'=>Yii::t('site','View Vehicle {recordName}',array('{recordName}'=>$model->recordName))))
        ),
        array(
            'name'=>'partyId',
            'type'=>'raw',
            'value'=>CHtml::link($model->customer->recordName,array('/party/view','id'=>$model->partyId))
        ),
        'vehicleIdentificationNbr',
        'make',
        'model',
        'modelYear',
        array(
            'name'=>'registrationDate',
            'type'=>'raw',
            'value'=>Yii::app()->dateFormatter->formatDateTime($model->registrationDate,'medium',null)
        ),
        array(
            'name'=>'nextTechCheckDate',
            'type'=>'raw',
            'value'=>$model->nextTechCheckDate=='' ? '' : Yii::app()->dateFormatter->formatDateTime($model->nextTechCheckDate,'medium',null)
        ),
        array(
            'name'=>'nextInspectionDate',
            'type'=>'raw',
            'value'=>$model->nextInspectionDate=='' ? '' : Yii::app()->dateFormatter->formatDateTime($model->nextInspectionDate,'medium',null)
        ),
    ),
);
for($i=1; $i<=5; $i++) {
    if($model->getAttributeLabel('field'.$i)<>'') 
        $config['attributes'][] = 'field'.$i;
}
?>
<?php $this->widget('zii.widgets.CDetailView', $config); ?>
